package com.bojiu.lawsearch.lawsearch.controller;

import com.bojiu.lawsearch.lawsearch.model.UserQuestion;
import com.bojiu.lawsearch.lawsearch.util.JsonResult;
import io.swagger.annotations.*;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

/**
 * @author: afdiao
 * @Date：2020/3/23 23:10
 * @Description:
 */
//@Api(description = "用户提问")
@RestController
@RequestMapping("question")
public class QuestionController {

    @ApiOperation(value = "创建业务员", notes = "管理员创建业务员")
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
            @ApiResponse(code = 600, message = "未检测到登录，跳转重新登录"),
            @ApiResponse(code = 500, message = "没有权限访问该接口"),
            @ApiResponse(code = 1200, message = "请求字段为空")
    })
    @PostMapping("publish")
    public JsonResult publish(@ApiParam(name = "问题对象", value = "json格式", required = true) @Valid @RequestBody UserQuestion userQuestion, Errors errors, HttpServletRequest request) {
        //TODO：校验登录权限
        //TODO：校验是否是会员
        //TODO：扣费是否成功

        return null;
    }
}
